﻿function Remove-TSMNode {
    <#
        .SYNOPSIS
            Remove TSM node
                    
        .DESCRIPTION
            The Remove-TSMNode removes a TSM node
        
        .EXAMPLE
            Remove-TSMNode node1

        .NOTES
            Contributors:  David Seibel
            Last Revision Date: 09/03/2015
    #>
    [CmdletBinding()]
    Param(
        [Parameter(Position = 0, Mandatory = $true)]
        $Node,

        [switch]$RemoveReplication
    )

    if ($RemoveReplication) {
        Remove-TSMNodeReplication $Node
    }

    $command = "Remove Node $Node" 

    $output = Invoke-TSMCommand -Command $command

    return $output
}